package com.tsystems.clientEmployee.application;

import javax.swing.JOptionPane;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.tsysstems.clientEmployee.ClientEmployee;
import com.tsystems.clientEmployee.gui.LoginPanel;
import com.tsystems.clientEmployee.gui.MainPanel;

public class ClientEmployeeApplication {

	private final Logger logger = LoggerFactory.getLogger(getClass());

	public ClientEmployeeApplication() {
		logger.info("Client Employee start");

		if (!ClientEmployee.getInstance().init()) {
			logger.info("Can't connect to server");
			JOptionPane.showMessageDialog(null,
					"Не удалось подключиться серверу!");
			return;
		}

		if (LoginPanel.showDialog() != null) {
			MainPanel.showFrame();
		}
	}

	public static void main(String[] args) {
		new ClientEmployeeApplication();
	}

}
